package com.woniu.rabbit.topic_model.consumer;

import com.woniu.rabbit.topic_model.topic_queue_conf.TopicExchangeAndQueueConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class TopicConsumer {
    /**
     * 创建1号监听对象
     *
     * */
    @RabbitListener(queues = TopicExchangeAndQueueConfig.QUEUE_NAME01)
    public void consumer01(String msg) {
        log.info("TopicConsumer01接收到消息：{}",msg);
    }

    /**
     * 创建2号监听对象
     * */
    @RabbitListener(queues = TopicExchangeAndQueueConfig.QUEUE_NAME02)
    public void consumer02(String msg) {
        log.info("TopicConsumer02接收到消息：{}",msg);
    }


}
